package com.riven.redisson.concurrent;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.reflect.MethodSignature;

/**
 * @author riven
 * @since 2025-05-26
 */
public abstract class BaseLockSubjectResolver implements LockSubjectResolver {
    @Override
    public Object resolve(ProceedingJoinPoint joinPoint) {
        Signature signature = joinPoint.getSignature();
        if (!(signature instanceof MethodSignature methodSignature)) {
            return null;
        }
        return doResolve(methodSignature, joinPoint.getArgs());
    }

    public abstract Object doResolve(MethodSignature methodSignature, Object[] args);

}
